package com.ehl.controller.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.ehl.annotation.Controller;
import org.ehl.annotation.RequestMapping;

import com.ehl.controller.frombean.LoginBean;
@Controller("/login")
public class loginAction {

	@RequestMapping("tologin")
	public String excute(HttpServletRequest request,HttpServletResponse response,HttpServletResponse session,LoginBean login) {
		System.out.println(request);
		System.out.println(response);
		System.out.println(session);
		System.out.println(login);
		request.setAttribute("login", login);
		if (login.getUsername().equals("hunt")) {
			return "/view/success.jsp";//成功跳转页面
		} else {
			return "/view/error.jsp";//失败跳转页面
		}
	}
}